Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

CssProviderLeaf performance #674

Open
rossati opened this issue Nov 15, 2022 · 2 comments
Open

CssProviderLeaf performance #674

rossati opened this issue Nov 15, 2022 · 2 comments

Comments

@rossati
Copy link

rossati commented Nov 15, 2022

Hi

It is normal that CssProviderLeaf lasts about 1600 milliseconds?

        println("btnTime 1:   ",Dates.now() - btnTime)
        pr = Gtk.CssProviderLeaf(data="#$name {background:#C0C0C0;border-width:2px}")
        println("btnTime 2:   ",Dates.now() - btnTime)
btnTime 1:   14 milliseconds
btnTime 2:   1627 milliseconds

Regards
Giovanni Rossati

@tknopp
Copy link
Collaborator

tknopp commented Nov 15, 2022

Cannot confirm:

julia> @time Gtk.CssProviderLeaf(data="#name {background:#C0C0C0;border-width:2px}")
  0.000078 seconds (6 allocations: 96 bytes)

@rossati
Copy link
Author

rossati commented Nov 16, 2022

Thanks Tobias

Can be a problem on my intallation?

Microsoft Windows [Versione 10.0.19044.2251]
(c) Microsoft Corporation. Tutti i diritti sono riservati.
...
 _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.1 (2022-09-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Gtk

julia> name ="FieldName"
"FieldName"

julia> @time Gtk.CssProviderLeaf(data="#$name {background:#C0C0C0;border-width:2px}")
  3.397363 seconds (118.32 k allocations: 5.960 MiB, 7.66% compilation time)
GtkCssProviderLeaf()

julia> @time Gtk.CssProviderLeaf(data="#name {background:#C0C0C0;border-width:2px}")
  3.968938 seconds (6 allocations: 96 bytes)
GtkCssProviderLeaf()

(Reading your answers has advanced my knowledge of Julia)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants