JuliaText / Embeddings.jl

Functions and data dependencies for loading various word embeddings (Word2Vec, FastText, GLoVE)
MIT License
81 stars 19 forks source link

use `PrecompileTools` #43

Closed theogf closed 1 year ago

theogf commented 1 year ago

using Embeddings takes ~ 9s due to the heavy __init__ by moving the load to precompilation we only need to compute this making it a lighter dependency.

oxinabox commented 1 year ago

It's using DataDeps, which registers things in a global dictionary. Which at least used to break if you just ran it at top level. Does it work if you use precompile tools?

theogf commented 1 year ago

Good point! Sorry for not checking more thorougly, I put the init calls in a function and call it from both PrecompileTools and __init__.

using Embeddings time still goes down to 0.21s!

mforets commented 1 year ago

@oxinabox Could you please register a new release of Embeddings.jl that contains this?

theogf commented 1 year ago

@oxinabox Could you please register a new release of Embeddings.jl that contains this?

It is registered already. It's just TagBot which was not triggered